/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package patterns.singleton;

import java.util.Date;

/**
 *
 * @author Zeus
 */
public class Singleton {
    private static Singleton theOnlyOne;
    private Date d=new Date();
    
    private Singleton(){
        
    }
    
    public synchronized static Singleton instance(){
        if(theOnlyOne==null){
            theOnlyOne=new Singleton();
        }
        return theOnlyOne;
    }
    
    public Date getDate(){
        return d;
    }
}
